// pages/lyContext/lyContext.ts
Page({

  /**
   * 页面的初始数据
   */
  data: {
    info:{} as any,
    userInfo:{} 
  },
  //打电话
  contact(){
    let number = this.data.info.number
    wx.makePhoneCall({
      phoneNumber: number
    })
  },
  copy(){
    let wxCode = this.data.info.wxCode
    wx.setClipboardData({data: wxCode})
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad() {
    const eventChannel = this.getOpenerEventChannel()
    eventChannel.on('context',(info) =>{
      info.createTime = info.createTime.substring(0,10);
      let userInfo = wx.getStorageSync('userInfo')
      this.setData({info,userInfo})
    })
  }
})